Optimal. Leaf size=331 \[ -\frac{\sqrt{2} c \left (\sqrt{b^2-4 a c} \left (b^2-a c\right )-3 a b c+b^3\right ) \tan ^{-1}\left (\frac{\tan \left (\frac{x}{2}\right ) \left (b-\sqrt{b^2-4 a c}\right )+2 c}{\sqrt{2} \sqrt{-b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}\right )}{a^3 \sqrt{b^2-4 a c} \sqrt{-b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}+\frac{\sqrt{2} c \left (-\sqrt{b^2-4 a c} \left (b^2-a c\right )-3 a b c+b^3\right ) \tan ^{-1}\left (\frac{\tan \left (\frac{x}{2}\right ) \left (\sqrt{b^2-4 a c}+b\right )+2 c}{\sqrt{2} \sqrt{b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}\right )}{a^3 \sqrt{b^2-4 a c} \sqrt{b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}-\frac{\left (b^2-a c\right ) \tanh ^{-1}(\cos (x))}{a^3}+\frac{b \cot (x)}{a^2}-\frac{\tanh ^{-1}(\cos (x))}{2 a}-\frac{\cot (x) \csc (x)}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 3.21015, antiderivative size = 331, normalized size of antiderivative = 1., number of steps used = 14, number of rules used = 9, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.474, Rules used = {3256, 3770, 3767, 8, 3768, 3292, 2660, 618, 204} \[ -\frac{\sqrt{2} c \left (\sqrt{b^2-4 a c} \left (b^2-a c\right )-3 a b c+b^3\right ) \tan ^{-1}\left (\frac{\tan \left (\frac{x}{2}\right ) \left (b-\sqrt{b^2-4 a c}\right )+2 c}{\sqrt{2} \sqrt{-b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}\right )}{a^3 \sqrt{b^2-4 a c} \sqrt{-b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}+\frac{\sqrt{2} c \left (-\sqrt{b^2-4 a c} \left (b^2-a c\right )-3 a b c+b^3\right ) \tan ^{-1}\left (\frac{\tan \left (\frac{x}{2}\right ) \left (\sqrt{b^2-4 a c}+b\right )+2 c}{\sqrt{2} \sqrt{b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}\right )}{a^3 \sqrt{b^2-4 a c} \sqrt{b \sqrt{b^2-4 a c}-2 c (a+c)+b^2}}-\frac{\left (b^2-a c\right ) \tanh ^{-1}(\cos (x))}{a^3}+\frac{b \cot (x)}{a^2}-\frac{\tanh ^{-1}(\cos (x))}{2 a}-\frac{\cot (x) \csc (x)}{2 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3256
Rule 3770
Rule 3767
Rule 8
Rule 3768
Rule 3292
Rule 2660
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{\csc ^3(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx &=\int \left (\frac{\left (b^2-a c\right ) \csc (x)}{a^3}-\frac{b \csc ^2(x)}{a^2}+\frac{\csc ^3(x)}{a}+\frac{-b^3 \left (1-\frac{2 a c}{b^2}\right )-b^2 c \left (1-\frac{a c}{b^2}\right ) \sin (x)}{a^3 \left (a+b \sin (x)+c \sin ^2(x)\right )}\right ) \, dx\\ &=\frac{\int \frac{-b^3 \left (1-\frac{2 a c}{b^2}\right )-b^2 c \left (1-\frac{a c}{b^2}\right ) \sin (x)}{a+b \sin (x)+c \sin ^2(x)} \, dx}{a^3}+\frac{\int \csc ^3(x) \, dx}{a}-\frac{b \int \csc ^2(x) \, dx}{a^2}+\frac{\left (b^2-a c\right ) \int \csc (x) \, dx}{a^3}\\ &=-\frac{\left (b^2-a c\right ) \tanh ^{-1}(\cos (x))}{a^3}-\frac{\cot (x) \csc (x)}{2 a}+\frac{\int \csc (x) \, dx}{2 a}+\frac{b \operatorname{Subst}(\int 1 \, dx,x,\cot (x))}{a^2}+\frac{\left (c \left (b^3-3 a b c-\sqrt{b^2-4 a c} \left (b^2-a c\right )\right )\right ) \int \frac{1}{b+\sqrt{b^2-4 a c}+2 c \sin (x)} \, dx}{a^3 \sqrt{b^2-4 a c}}-\frac{\left (c \left (b^3-3 a b c+\sqrt{b^2-4 a c} \left (b^2-a c\right )\right )\right ) \int \frac{1}{b-\sqrt{b^2-4 a c}+2 c \sin (x)} \, dx}{a^3 \sqrt{b^2-4 a c}}\\ &=-\frac{\tanh ^{-1}(\cos (x))}{2 a}-\frac{\left (b^2-a c\right ) \tanh ^{-1}(\cos (x))}{a^3}+\frac{b \cot (x)}{a^2}-\frac{\cot (x) \csc (x)}{2 a}+\frac{\left (2 c \left (b^3-3 a b c-\sqrt{b^2-4 a c} \left (b^2-a c\right )\right )\right ) \operatorname{Subst}\left (\int \frac{1}{b+\sqrt{b^2-4 a c}+4 c x+\left (b+\sqrt{b^2-4 a c}\right ) x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )}{a^3 \sqrt{b^2-4 a c}}-\frac{\left (2 c \left (b^3-3 a b c+\sqrt{b^2-4 a c} \left (b^2-a c\right )\right )\right ) \operatorname{Subst}\left (\int \frac{1}{b-\sqrt{b^2-4 a c}+4 c x+\left (b-\sqrt{b^2-4 a c}\right ) x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )}{a^3 \sqrt{b^2-4 a c}}\\ &=-\frac{\tanh ^{-1}(\cos (x))}{2 a}-\frac{\left (b^2-a c\right ) \tanh ^{-1}(\cos (x))}{a^3}+\frac{b \cot (x)}{a^2}-\frac{\cot (x) \csc (x)}{2 a}-\frac{\left (4 c \left (b^3-3 a b c-\sqrt{b^2-4 a c} \left (b^2-a c\right )\right )\right ) \operatorname{Subst}\left (\int \frac{1}{4 \left (4 c^2-\left (b+\sqrt{b^2-4 a c}\right )^2\right )-x^2} \, dx,x,4 c+2 \left (b+\sqrt{b^2-4 a c}\right ) \tan \left (\frac{x}{2}\right )\right )}{a^3 \sqrt{b^2-4 a c}}+\frac{\left (4 c \left (b^3-3 a b c+\sqrt{b^2-4 a c} \left (b^2-a c\right )\right )\right ) \operatorname{Subst}\left (\int \frac{1}{-8 \left (b^2-2 c (a+c)-b \sqrt{b^2-4 a c}\right )-x^2} \, dx,x,4 c+2 \left (b-\sqrt{b^2-4 a c}\right ) \tan \left (\frac{x}{2}\right )\right )}{a^3 \sqrt{b^2-4 a c}}\\ &=-\frac{\sqrt{2} c \left (b^3-3 a b c+\sqrt{b^2-4 a c} \left (b^2-a c\right )\right ) \tan ^{-1}\left (\frac{2 c+\left (b-\sqrt{b^2-4 a c}\right ) \tan \left (\frac{x}{2}\right )}{\sqrt{2} \sqrt{b^2-2 c (a+c)-b \sqrt{b^2-4 a c}}}\right )}{a^3 \sqrt{b^2-4 a c} \sqrt{b^2-2 c (a+c)-b \sqrt{b^2-4 a c}}}+\frac{\sqrt{2} c \left (b^3-3 a b c-\sqrt{b^2-4 a c} \left (b^2-a c\right )\right ) \tan ^{-1}\left (\frac{2 c+\left (b+\sqrt{b^2-4 a c}\right ) \tan \left (\frac{x}{2}\right )}{\sqrt{2} \sqrt{b^2-2 c (a+c)+b \sqrt{b^2-4 a c}}}\right )}{a^3 \sqrt{b^2-4 a c} \sqrt{b^2-2 c (a+c)+b \sqrt{b^2-4 a c}}}-\frac{\tanh ^{-1}(\cos (x))}{2 a}-\frac{\left (b^2-a c\right ) \tanh ^{-1}(\cos (x))}{a^3}+\frac{b \cot (x)}{a^2}-\frac{\cot (x) \csc (x)}{2 a}\\ \end{align*}
Mathematica [C] time = 1.63299, size = 481, normalized size = 1.45 \[ \frac{\csc ^2(x) (-2 a-2 b \sin (x)+c \cos (2 x)-c) \left (-4 \left (a^2-2 a c+2 b^2\right ) \log \left (\sin \left (\frac{x}{2}\right )\right )+4 \left (a^2-2 a c+2 b^2\right ) \log \left (\cos \left (\frac{x}{2}\right )\right )+a^2 \csc ^2\left (\frac{x}{2}\right )-a^2 \sec ^2\left (\frac{x}{2}\right )+\frac{8 c \left (b^2 \sqrt{4 a c-b^2}-a c \sqrt{4 a c-b^2}+3 i a b c-i b^3\right ) \tan ^{-1}\left (\frac{2 c+\tan \left (\frac{x}{2}\right ) \left (b-i \sqrt{4 a c-b^2}\right )}{\sqrt{2} \sqrt{-i b \sqrt{4 a c-b^2}-2 c (a+c)+b^2}}\right )}{\sqrt{2 a c-\frac{b^2}{2}} \sqrt{-i b \sqrt{4 a c-b^2}-2 c (a+c)+b^2}}+\frac{8 c \left (b^2 \sqrt{4 a c-b^2}-a c \sqrt{4 a c-b^2}-3 i a b c+i b^3\right ) \tan ^{-1}\left (\frac{2 c+\tan \left (\frac{x}{2}\right ) \left (b+i \sqrt{4 a c-b^2}\right )}{\sqrt{2} \sqrt{i b \sqrt{4 a c-b^2}-2 c (a+c)+b^2}}\right )}{\sqrt{2 a c-\frac{b^2}{2}} \sqrt{i b \sqrt{4 a c-b^2}-2 c (a+c)+b^2}}+4 a b \tan \left (\frac{x}{2}\right )-4 a b \cot \left (\frac{x}{2}\right )\right )}{16 a^3 \left (a \csc ^2(x)+b \csc (x)+c\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.184, size = 1369, normalized size = 4.1 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc ^{3}{\left (x \right )}}{a + b \sin{\left (x \right )} + c \sin ^{2}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]